package com.igogogo.model.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.igogogo.model.dao.Ig_CategoryMapper;
import com.igogogo.model.entity.Ig_Category;
import com.igogogo.model.service.Ig_CategoryService;

@Service
@Transactional
public class Ig_CategoryServiceImpl implements Ig_CategoryService {

	@Autowired
	private Ig_CategoryMapper igCategoryMapper;

	@Override
	public int add(Ig_Category t) {
		return igCategoryMapper.insertSelective(t);
	}

	@Override
	public int delete(Integer id) {
		return igCategoryMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int update(Ig_Category t) {
		return igCategoryMapper.updateByPrimaryKeySelective(t);
	}

	@Override
	public List<Ig_Category> query() {
		return igCategoryMapper.query();
	}

	@Override
	public Ig_Category queryById(Integer id) {
		return igCategoryMapper.queryById(id);
	}

	@Override
	public List<Ig_Category> queryByPage(Map<String, Object> map) {
		return igCategoryMapper.queryByPage(map);
	}

	@Override
	public List<Ig_Category> queryByCondition(Map<String, Object> condition) {
		return igCategoryMapper.queryByCondition(condition);
	}

	@Override
	public int addmore(List<Ig_Category> ts) {
		int result = 0;
		try {
			for (Ig_Category igCategory : ts) {
				igCategoryMapper.insertSelective(igCategory);
			}
			result = 1;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}

	@Override
	public int deleteByMoreId(List<Integer> ids) {
		return igCategoryMapper.deleteByMoreId(ids);
	}

	@Override
	public int updatemore(List<Ig_Category> ts) {
		int result = 0;
		try {
			for (Ig_Category igCategory : ts) {
				igCategoryMapper.updateByPrimaryKeySelective(igCategory);
			}
			result = 1;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}

	@Override
	public int queryCount() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<Ig_Category> queryKeyWordByPage(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int queryCountByKeyWord(String keyword) {
		// TODO Auto-generated method stub
		return 0;
	}

}
